/*
 * @Author: sikonggpw 1327325804@qq.com
 * @Date: 2023-02-17 11:06:23
 * @LastEditors: sikonggpw 1327325804@qq.com
 * @LastEditTime: 2023-02-17 11:17:08
 * @FilePath: \vue1\fontCss\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const path = require('path')
// 获取当前文件的路径
const cwd = process.cwd()
// 只匹配Vue文件
const defaultPattern = ['**/*.vue']
// node自带的查找文件 更快 而且支持异步
const fg = require('fast-glob')
// 开刷的路径
const boilerplatePath = path.resolve(cwd, './src')


async function getVuePages() {
  const pagePaths = await fg.sync(defaultPattern, {
    cwd: boilerplatePath,
    onlyFiles: true
  })
  console.log(boilerplatePath);
  let viewsPages = await fg.sync(defaultPattern, {
    cwd: boilerplatePath,
    onlyFiles: true
  })

  viewsPages = viewsPages.concat(pagePaths)
  return viewsPages
}

async function main() {
  const vuePages = await getVuePages()
  console.log(vuePages, 'vuePages');
}

main()